package com.kdd.campus.sh.dao;
import com.kdd.campus.sh.po.ShOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:shenkunlin
 * @Description:ShOrder的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface ShOrderMapper extends Mapper<ShOrder> {
    @Select("select * from sh_order JOIN sh_order_item on sh_order.id=sh_order_item.orderId " +
            "where buyerId=#{userId} and `status`=1 AND sh_order_item.productName LIKE '%${keyword}%' " +
            "ORDER BY sh_order.create_time DESC")
    List<ShOrder> findByKeyword(Long userId, Integer pageNum,Integer pageSize, String keyword);
}

